﻿using Shinva.Variables.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using DataType = Shinva.Variables.Models.DataType;

namespace Shinva.Variables.Interface
{
  public  interface IPlcMember 
    {
        //名称
        string Name { get; set; }

        string FullName { get; set; }
        //符号
        string Symbol { get; set; }
        //数据类型
        DataType DataType { get; }
        //偏移地址
        PlcAddress Address { get; set; }

        //值
        string Value { get; set; }

        //占用位数
        int SizeInBits { get; set; }
        /// <summary>
        /// 根据占用位数计算占用字节数
        /// </summary>
        /// <returns></returns>
        int SizeInBytes();

        /// <summary>
        /// 上一级变量
        /// </summary>
        IPlcMember Parent { get; set; }
    }
}
